#ifndef LAYER_H
#define LAYER_H
#include <QObject>
#include <QImage>
#include "Ptr.hpp"
#include "InterpolateBase.h"
#include "AlgebraicOperation.hpp"


using namespace OOPUtils;



class Layer : public QObject
{

  Q_OBJECT

public:

    Layer (const QString & layerName, Ptr< QImage > pImage = NULL);
    ~Layer ();



    void setName (const QString & name);
    const QString & getName () const;

    void setRegion (const QRect & newRegion);
    QRect & getRegion ();
    const QRect & getRegion () const;

    void setPreviewImage (Ptr< QImage > image);
    Ptr< QImage > getPreviewImage ();
    const Ptr< QImage > getPreviewImage () const;
    
    void setImage (Ptr< QImage > pImage);
    Ptr< QImage > getImage ();
    const Ptr< QImage > getImage () const;

    Ptr< AlgebraicOperation > getCompositionOperation ();
    void setCompositionOperation (Ptr< AlgebraicOperation > op);

    void openPreview ();
    void closePreview ();
    bool isInPreviewMode () const;

private:

  QString _name;
  Ptr< QImage > _pImage;
  Ptr< QImage > _pPreview;
  QRect _region;
  bool _isInPreviewMode;
  Ptr< AlgebraicOperation > _pCompositionOperation;

signals:

  void layerModeChanged ();
    
};

#endif // LAYER_H